
import request from "@/utils/request";
class BannerApi {
  // 游戏类型
  static getList (data) {
    return request({
      url: "/api/admin/banners",
      method: "get",
      params: data
    });
  }
  static add (data) {
    return request({
      url: "/api/admin/banners",
      method: "post",
      data: data,

    });
  }
  static put (data) {
    return request({
      url: `/api/admin/banners/${data.id}`,
      method: "PUT",
      data: data,

    });
  }
  static del (data) {
    return request({
      url: `/api/admin/banners/${data.id}`,
      method: "DELETE",
    });
  }
  static upload (file) {
    const formData = new FormData();
    formData.append("image", file);
    return request({
      url: "/api/admin/banners-upload",
      method: "POST",
      data: formData,
      headers: {
        "Content-Type": "multipart/form-data",
      },
    });
  }
}
export default BannerApi;